﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.BLL;
using Automobile.service.Model;

namespace Automobile.service.UI
{
    public partial class AddEmployee : System.Web.UI.Page
    {  
        EmployeeBll bll = new EmployeeBll();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            EmployeeModel emp = new EmployeeModel();
           
            emp.Employee_Name =this.TextBox3.Text.ToString();
            emp.Employee_Pwd =this.TextBox4.Text.ToString();
            emp.Employee_Phone = this.TextBox5.Text.ToString();
            emp.Employee_Addr =    this.TextBox6.Text.ToString();
            emp.Employee_State =  this.TextBox7.Text.ToString();
            emp.Employee_Remark =  this.TextBox8.Text.ToString();
            if (bll.AddEmployee(emp) > 0)
            {
                Response.Write("<script>alert('添加成功!');location.href='Employee.aspx';</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败!');</script>");
            }

        }

        protected void btnBack_Click(object sender, EventArgs e)
        {
            Response.Redirect("Employee.aspx");
        }
    }
}